﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once 

#include "IDbObject.h"
#include "GcmpModelInterface.h"
#include "RegenDataId.h"

namespace gcmp
{
    class Vector3d;
    class IElement;
    class IModelView;

    /// \brief 族实例可移动控制点组件接口
    class GCMP_MODEL_INTERFACE_EXPORT IInstanceMovablePointComponent : public IDbObject
    {
        DEFINE_CAST_DERIVED(gcmp::IInstanceMovablePointComponent, gcmp::IDbObject);

    public:

        /// \brief 获得族实例在ModelView中可移动控制点数据
        /// \return 返回ModelView中族实例可移动控制点和序号
        virtual const std::map<int, Vector3d> GetMovablePoints(const gcmp::IModelView* pModelView) const = 0;

        /// \brief 通过序号获得族实例可移动控制点数据
        /// \return 返回族实例可移动控制点
        virtual const Vector3d GetMovablePoint(int index, const gcmp::IModelView* pModelView) const =0;

        /// \brief 设置族实例可移动控制点
        ///
        /// 设置后会触发关联更新
        /// \param opPosition 新的控制点位置
        /// \return 
        virtual void SetMovablePoint(int index, Vector3d opPosition) = 0;

    public:
        /// \brief 设置该行为所属Element
        /// \param pOwnerElement 所属Element
        /// \return bool
        virtual bool SetOwnerElement(IElement* pOwnerElement) = 0;

        /// \brief 获得该行为所属的Element
        /// \return 所属的Element
        virtual IElement* GetOwnerElement() = 0;

        /// \brief 获得该行为所属的Element
        /// \return 所属的Element
        virtual const IElement* GetOwnerElement() const = 0;
    };

}



